package com.genesis.yunnanji.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.genesis.yunnanji.R;
import com.genesis.yunnanji.bean.MushRoomBean;
import com.genesis.yunnanji.config.GenesisApiConfig;

import java.util.List;

/**
 * Created by Administrator on 2018/4/17.
 */

public class MushRoomHorizontal extends BaseQuickAdapter<MushRoomBean.ResultBean.SpelistBean, BaseViewHolder> {
    private Context context;

    public MushRoomHorizontal(@Nullable List<MushRoomBean.ResultBean.SpelistBean> data, Context context) {
        super(R.layout.layout_mushroom_item, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MushRoomBean.ResultBean.SpelistBean item) {
        Glide.with(context).load(GenesisApiConfig.PIC_HOST + item.getCover_img()).into((ImageView) helper.getView(R.id.iv_mushroom_item));
    }
}
